import japa.parser.JavaParser;
import japa.parser.ast.CompilationUnit;
import japa.parser.ast.body.MethodDeclaration;
import japa.parser.ast.body.Parameter;
import japa.parser.ast.visitor.VoidVisitorAdapter;

import java.io.File;
import java.io.FileInputStream;

import javax.swing.JFileChooser;
import javax.swing.JFrame;


public class LongParameterLists {

	public LongParameterLists(CompilationUnit cu){

        System.out.println("Number of lines " +cu.getEndLine());
        
       
        ParameterVisitor pv = new ParameterVisitor();
        pv.visit(cu, null);
        pv.printCount();
        // visit and print the methods names
        
            
       
        
    }

    /**
     * Simple visitor implementation for visiting MethodDeclaration nodes. 
     */
    private static class ParameterVisitor extends VoidVisitorAdapter {
    	int count=0;
        
    	@Override
        public void visit(Parameter n, Object arg) {
            // here you can access the attributes of the method.
            // this method will be called for all methods in this 
            // CompilationUnit, including inner class methods
        	count ++;
        	System.out.println(n.getType() + " " + n.getId());
        			      	
                    
        }

		public void printCount() {
			// TODO Auto-generated method stub
			System.out.println("The number of Parameters used in this class " + count);
		}
    	
    	
    	
}
}